/* eslint-disable no-undef */
'use strict'

const path = require('path')

// var targetUrl = 'https://www.rnb580.top'
// var targetUrl = "http://192.168.1.16:9991";

function resolve(dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  baseUrl: process.env.NODE_ENV == 'production' ? '' : '',
  outputDir: './dist',
  assetsDir: '',
  indexPath: './index.html',
  lintOnSave: true,
  css: {
    loaderOptions: {
      postcss: {
        plugins: [
          require('postcss-pxtorem')({
            rootValue: 50, // 换算的基数
            selectorBlackList: ['weui', 'mu', 'ivu-'], // 忽略转换正则匹配项
            propList: ['*']
          })
        ]
      }
    }
  },
  configureWebpack: {
    resolve: {
      alias: {
        styles: resolve('src/assets/styles'),
        '@': resolve('src'),
        vue$: 'vue/dist/vue.js'
      }
    },
    devServer: {
      proxy: {
        '/sys': {
          target: targetUrl
        },
        '/member': {
          target: targetUrl
        },
        '/auth': {
          target: targetUrl
        },
        '/bus': {
          target: targetUrl
        },
        '/image': {
          target: targetUrl
        },
      }
    }
  },

}